package singleLanguageOnlineCodingSubmission

import org.springframework.cloud.contract.spec.Contract

Contract.make {
    request {
        method("POST")
        url("/api/single-language-online-coding-submissions")
        body("""
        {
            "userAnswerCode":"hjiojoi",
            "language":"java",
            "id":1,
            "assignmentId":1,
            "studentId":1,        
        }
        """)
        bodyMatchers {
            jsonPath('$.userAnswerCode', byRegex("[\\S\\s]+"))
            jsonPath('$.language', byRegex("[\\S\\s]+"))
            jsonPath('$.id', byRegex(number()))
            jsonPath('$.assignmentId', byRegex(number()))
            jsonPath('$.studentId', byRegex(number()))
        }
        headers {
            contentType(applicationJsonUtf8())
        }
    }
    response {
        status(200)
    }
}
